package com.atguigu.day09;

import org.apache.flink.contrib.streaming.state.RocksDBStateBackend;
import org.apache.flink.runtime.state.filesystem.FsStateBackend;
import org.apache.flink.runtime.state.memory.MemoryStateBackend;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.connectors.kafka.FlinkKafkaProducer;

import java.io.IOException;

public class Flink01_CK_StateBackend {

    public static void main(String[] args) throws IOException {

        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        //设置状态后端
        env.setStateBackend(new MemoryStateBackend());
        env.setStateBackend(new FsStateBackend("hdfs://hadoop102:8020/flink1109/ck"));
        env.setStateBackend(new RocksDBStateBackend("hdfs://hadoop102:8020/flink1109/ck"));


//        env.socketTextStream("",9999)
//                .addSink(new FlinkKafkaProducer<String>())

    }


}
